public class demo7 {
    public static void main(String[] args) throws InterruptedException {

        Thread thread = new Thread(()->{
            while (true){
                System.out.println(1);
            }
        });
        thread.start();

        thread.join();
        System.out.println("正在执行 main 线程");
    }
}
